const db = require("../../config/db");

module.exports = {
    get_banner() {
        return new Promise((resolve, reject) => {
            let get_banner_sql = `select * from db_banner`;

            db.query(get_banner_sql, (error, result) => {
                if (error) {
                    reject({
                        code: -1,
                        msg: "获取轮播图失败",
                        error,
                    });
                } else {
                    resolve(result);
                }
            });
        });
    },
};
